import service from "./request";

// 合同
export const contractApproved = () => {
    return service({ url: `/tienchin/contract/approved`, method: "get" })
}

export const contractCommitted = () => {
    return service({ url: `/tienchin/contract/committed_task`, method: "get" })
}

export const contractUser = (data: any) => {
    return service({ url: `/tienchin/contract/views/${data}`, method: "get" })
}

//促销
export const activityList = () => {
    return service({ url: `/tienchin/activity/list`, method: "get" })
}
export const findActivity = (data: any) => {
    return service({ url: `/tienchin/activity/list`, method: "get", params: data })
}
export const channelList = () => {
    return service({ url: `/tienchin/activity/channel/list`, method: "get" })
}

export const addActivity = (data: any) => {
    return service({ url: `/tienchin/activity`, method: "post", data: data })
}

export const expostActivity = () => {
    return service({ url: `/tienchin/activity/export`, method: "post" })
}
export const editActivity = (data: any) => {
    return service({ url: `/tienchin/activity`, method: "put", data: data })
}
export const ActivityData = (data: any) => {
    return service({ url: `/tienchin/activity/${data}`, method: "get" })
}

export const ActivityDelete = (data: any) => {
    return service({ url: `/tienchin/activity/${data}`, method: "delete" })
}

// 渠道
export const ChannelListget = () => {
    return service({ url: `/tienchin/channel/list`, method: "get" })
}
export const findChannel = (data: any) => {
    return service({ url: `/tienchin/channel/list`, method: "get", params: data })
}

export const addChannel = (data: any) => {
    return service({ url: `/tienchin/channel`, method: "post", data: data })
}

export const expostChannel = () => {
    return service({ url: `/tienchin/channel/export`, method: "post" })
}
export const editChannel = (data: any) => {
    return service({ url: `/tienchin/channel`, method: "put", data: data })
}
export const ChannelData = (data: any) => {
    return service({ url: `/tienchin/channel/${data}`, method: "get" })
}

export const ChannelDelete = (data: any) => {
    return service({ url: `/tienchin/channel/${data}`, method: "delete" })
}

// 商机
export const BusinessChannelList = () => {
    return service({ url: `/tienchin/business/channels`, method: "get" })
}
export const BusinessTreeselect = () => {
    return service({ url: `/system/dept/treeselect`, method: "get" })
}
export const BusinessUser = (data: any) => {
    return service({ url: `/tienchin/clue/users/${data}`, method: "get" })
}
export const BusinessActivityList = (data: any) => {
    return service({ url: `/tienchin/business/activity/${data}`, method: "get" })
}
export const BusinessListget = () => {
    return service({ url: `/tienchin/business/list`, method: "get" })
}
export const findBusiness = (data: any) => {
    return service({ url: `/tienchin/business/list`, method: "get", params: data })
}

export const addBusiness = (data: any) => {
    return service({ url: `/tienchin/business`, method: "post", data: data })
}
export const BusinessAssignment = (data: any) => {
    return service({ url: `/tienchin/assignment`, method: "post", data: data })
}
export const expostBusiness = () => {
    return service({ url: `/tienchin/business/export`, method: "post" })
}
export const editBusiness = (data: any) => {
    return service({ url: `/tienchin/business`, method: "put", data: data })
}
export const BusinessData = (data: any) => {
    return service({ url: `/tienchin/business/${data}`, method: "get" })
}

export const BusinessDelete = (data: any) => {
    return service({ url: `/tienchin/business/${data}`, method: "delete" })
}

// 商机详情
export const BusinessDetail = (data: any) => {
    return service({ url: `/tienchin/business/${data}`, method: "get" })
}

export const BusinessRecord = (data: any) => {
    return service({ url: `/tienchin/follow/record/business/${data}`, method: "get" })
}

export const BusinessCourse = () => {
    return service({ url: `/tienchin/business/all_course`, method: "get" })
}

export const BusinessClass = () => {
    return service({ url: `/tienchin/business/course/1`, method: "get" })
}

export const followBusiness = (data: any) => {
    return service({ url: `/tienchin/business/follow`, method: "post", data: data })
}

export const BusinessSex = () => {
    return service({ url: `/system/dict/data/type/sys_user_sex`, method: "get" })
}

export const BusinessOccupation = () => {
    return service({ url: `/system/dict/data/type/business_occupation`, method: "get" })
}

export const BusinessEducation = () => {
    return service({ url: `/system/dict/data/type/business_education`, method: "get" })
}
export const BusinessStatus = () => {
    return service({ url: `/system/dict/data/type/business_status`, method: "get" })
}
export const BusinessFocus = () => {
    return service({ url: `/system/dict/data/type/business_focus`, method: "get" })
}
export const BusinessType = () => {
    return service({ url: `/system/dict/data/type/course_type`, method: "get" })
}